import request from '@/config/axios'

// 调拨入库主 VO
export interface Rdrecord06VO {
  id: number // id
  serialNumber: string // 流水号
  personId: number // 业务员id
  deptId: number // 部门id
  inWarehouseId: number // 调入仓库id
  outWarehouseId: number // 调出仓库id
  orderDate: Date // 订单日期
  remark: string // 备注
  auditor: string // 审核人
  auditTime: Date // 审核时间
}

// 调拨入库主 API
export const Rdrecord06Api = {
  // 查询调拨入库主分页
  getRdrecord06Page: async (params: any) => {
    return await request.get({ url: `/wms/rdrecord06/page`, params })
  },

  // 查询调拨入库主详情
  getRdrecord06: async (id: string) => {
    return await request.get({ url: `/wms/rdrecord06/get?id=` + id })
  },

  // 新增调拨入库主
  createRdrecord06: async (data: Rdrecord06VO) => {
    return await request.post({ url: `/wms/rdrecord06/create`, data })
  },

  //提交
  submit: async (id: number) => {
    return await request.get({ url: `/wms/rdrecord06/startProcess?id=` + id })
  },

  // 修改调拨入库主
  updateRdrecord06: async (data: Rdrecord06VO) => {
    return await request.put({ url: `/wms/rdrecord06/update`, data })
  },

  // 删除调拨入库主
  deleteRdrecord06: async (id: number) => {
    return await request.delete({ url: `/wms/rdrecord06/delete?id=` + id })
  },

  // 导出调拨入库主 Excel
  exportRdrecord06: async (params) => {
    return await request.download({ url: `/wms/rdrecord06/export-excel`, params })
  },

// ==================== 子表（调拨入库子） ====================

  // 获得调拨入库子列表
  getRdrecords06ListByOrderId: async (orderId) => {
    return await request.get({ url: `/wms/rdrecord06/rdrecords06/list-by-order-id?orderId=` + orderId })
  },
}
